#ifndef _ESP_AUDIO_ALC_H_
#define _ESP_AUDIO_ALC_H_


/**
 * @brief      filter Configuration
 */
typedef struct {
    unsigned char *in_buf;      /*!< Input buffer */
    int type;                   /*!< type of filter. The type can be set, heart mode, lung mode, heart-lung mode -> 0, 1, 2 */
    int set_flag;               /* 1 for reopen for new filter coef*/
    int channel;                /*!< Number of channels for input stream */
    void *handle;               /*!< The handle for setting filter */
} filter_bandpass_set_t;



/**
 * @brief      Initialise filter setup 
 *
 * @return     Handle for setting filter
 */
void *bpfilter_open( int type);

/**
 * @brief      Stop and cleanup the handle for setting filter
 *
 * @param      handle     the handle for setting filter
 */
void bpfilter_close(void *handle);

/**
 * @brief      Process data buffer by setting filter
 *
 * @param      buffer     input and output buffer
 * @param      bytes      size of `buffer`. unit: bytes
 * @param      channels   the number of channels for input stream
 * @param      handle     the handle for setting filter
 * @param      type     the type to be set to
 *
 * @return     -1         the number of channels for input stream is not 1 or 2
 *              0         success
 */
int bpfilter_process(void *buffer, unsigned int bytes, int channels, void *handle, int type);


#endif
